<script setup>
import { watch } from 'vue';
import { storeToRefs } from 'pinia';
import { useCartStore } from './stores/cart';
import { useUserStore } from './stores/user'
const { userInfo } = storeToRefs(useUserStore())
//根据用户登录实时获取信息
watch(userInfo, async (n, o) => {
    if (n&&Object.keys(n).length > 0) {
       await useCartStore().getCartList()
        useUserStore().getAddrList()
    }
}, { immediate: true })


</script>

<template>
    <router-view></router-view>

</template>

<style scoped></style>
